﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//using System.Data.SqlClient;

namespace 影楼婚纱摄影系统
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private static string _id;// 账号
        public static string Id
        {
            get { return _id; }
            set { _id = value; }
        }

        private static string _name;
        public static string Name1 // 姓名
        {
            get { return _name; }
            set { _name = value; }
        }

        // 权限标记 值为admin为管理员 ，值为staff则为普通用户
        private static string _tag;
        public static string _Tag
        {
            get { return _tag; }
            set { _tag = value; }
        }



        // 在加载窗体时设定操作权限
        private void MainForm_Load(object sender, EventArgs e)
        {
            MainForm myForm = new MainForm();
            string form1 = MainForm._Tag;
            string form2 = MainForm.Id;
            string form3 = MainForm.Name1;

            if (form1 == "staff")
            {
                tSSL2.Text = "权限级别：普通员工";
                tSSL5.Text = "   " + Name1;

                添加员工.Enabled = false;
                添加员工ToolStripMenuItem.Enabled = false;
                管理员信息ToolStripMenuItem.Enabled = false;
                添加套系.Enabled = false;
                添加订单.Enabled = false;
                营业额ToolStripMenuItem.Enabled = false;
                业绩查询ToolStripMenuItem.Enabled = false;

            }
            else
            {
                tSSL2.Text = "权限级别：管理员";
                tSSL5.Text = "   " + Name1;
                个人业绩ToolStripMenuItem.Enabled = false;
            } 
        }

        #region 关于、帮助
        private void 关于软件ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("请联系管理员", "关于");
        }

        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            MessageBox.Show("请联系管理员", "注意");
        }
        #endregion

        // 时钟
        private void timer1_Tick(object sender, EventArgs e)
        {
            xxx.Text = DateTime.Now.ToString();
        }

        // 退出时关闭所有窗口（login）
        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit(); 
        }



        #region 添加用户
        private void addUser_Click(object sender, EventArgs e)
        {
            Form myform = new 添加用户();
            myform.ShowDialog();
        }
        #endregion

        #region 添加套系
        private void addStaff_Click(object sender, EventArgs e)
        {
            Form myform = new 添加套系();
            myform.ShowDialog();
        }
        #endregion


        #region 添加订单
        private void addOrder_Click(object sender, EventArgs e)
        {
            Form myform = new 添加订单();
            myform.ShowDialog();
        }
        #endregion



        private void 查询员工信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 员工信息();
            myform.ShowDialog();
        }

        private void 添加员工ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 添加员工();
            myform.ShowDialog();
        }

        private void 套系管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 套系管理();
            myform.ShowDialog();
        }

        private void 订单管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 订单管理();
            myform.ShowDialog();
        }

        private void 管理员信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 管理员管理();
            myform.ShowDialog();
        }

        private void 用户管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 用户信息管理();
            myform.ShowDialog();
        }

        private void 营业额ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 营业额管理();
            myform.ShowDialog();
        }

        private void 业绩查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 业绩查询();
            myform.ShowDialog();
        }

        private void 个人业绩ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 员工个人业绩查询();
            myform.ShowDialog();
        }

        private void 套系销量ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form myform = new 套系销量();
            myform.ShowDialog();
        }



    }
}
